package com.code.springbootwebsocket.controller.v3;

import com.code.springbootwebsocket.model.InMessage;
import com.code.springbootwebsocket.service.WebSocketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.stereotype.Controller;

/**
 * 功能描述：简单版单人聊天
 * @author: liyufei
 * @date: 2019-02-16 20:01
 */
@Controller
public class ChatRoomController {

    @Autowired
    private WebSocketService webSocketService;

    @MessageMapping("/v3/single/chat")
    public void singleChat(InMessage message) {
        webSocketService.sendChatMessage(message);
    }

}
